<template>
  <!--  <div>{{ this.$route.params.id }}</div>-->
  <div id="shop">
    <!--店内图片-->
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(item, i) in shop.shopImg" :key="i">
        <van-image :src="item" height='20rem' width='100%' />
      </van-swipe-item>
    </van-swipe>

    <van-divider dashed></van-divider>
    <van-row>
      <van-col>
        <van-button color="linear-gradient(to right, #ff6034, #ee0a24)" style="height: 100%; padding: 13px"
          @click="">店铺描述</van-button>
      </van-col>

      <van-col>
        <van-field label="电话" :placeholder="shop.shopInfo.shopPhone" right-icon="phone-o" readonly />
        <van-coupon-cell @click="showList = true" />
      </van-col>
    </van-row>
    <van-divider></van-divider>
    <van-button type="primary" block @click="goOrder">预约</van-button>
  </div>
</template>

<script setup>
import { onMounted, reactive, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { getShop } from '@/api'
import { useOrderInfoStore } from '@/store/orderInfoStore'

const router = useRouter()
const route=useRoute()

let orderInfoStore=useOrderInfoStore()

let shop = reactive({
  id: '1',
  shopName: '',
  shopImg: [
    'http://47.98.184.192:8085/LightPicture/2023/05/49d3c460a9557e5a.jpeg',
    'http://47.98.184.192:8085/LightPicture/2023/05/f57891d306c674ea.jpeg',
    'http://47.98.184.192:8085/LightPicture/2023/05/2a962573491efb20.jpeg',
    'http://47.98.184.192:8085/LightPicture/2023/05/802db2b4824cbdbe.jpeg',
  ],
  description: '这是一段测试描述',
  shopPhone: '11',
  shopTag: '网红',
  shopComment: '',
  remarks: '',
  shopInfo:{}
})

onMounted(()=>{
  // getShop(route.params.id).then((res)=>{
  //   if(res.code===0){
  //     shop=res.data
  //     // shop.shopInfo=res.data
  //   }
  // })
})

const goOrder = () => {
  orderInfoStore.$state={shopId:route.params.id}
  router.push('/discovery')
}
</script>

<style scoped></style>
